package com.afdor.rws.event.driven.channel.aliyun.mns.config;

import com.afdor.rws.annotation.extension.Extension;
import com.afdor.rws.annotation.extension.SPI;
import com.afdor.rws.event.driven.channel.aliyun.mns.utils.AliyunMnsUtils;
import com.afdor.rws.event.driven.config.EventConfig;
import com.afdor.rws.event.driven.config.EventConsumerConfig;
import lombok.Data;
import lombok.NonNull;

import java.io.Serializable;

/**
 * 阿里云MNS(消息服务) 消费者相关配置<br/>
 * Extension : prototype
 *
 * @author 悭梵
 * @date Created in 2018-11-21 15:45
 */
@Data
@SPI(AliyunMnsUtils.DEFAULT_COMPONENT_CONFIG_EXTENSION_NAME)
@Extension(value = AliyunMnsUtils.DEFAULT_COMPONENT_CONFIG_EXTENSION_NAME, scope = Extension.Scope.PROTOTYPE, interfaceClass = EventConsumerConfig.class)
public class AliyunMnsEventConsumerConfig extends EventConsumerConfig implements Serializable, Cloneable {

    /**
     * 在阿里云MNS(消息服务)服务器上，阻塞等待消息时间，单位：秒，默认不阻塞等待；
     */
    private int waitSeconds = -1;

    public AliyunMnsEventConsumerConfig() {
        super();
    }

    public AliyunMnsEventConsumerConfig(@NonNull final EventConfig eventConfig) {
        super(eventConfig);
    }
}
